Skip to content

Add google analytics support#929

Merged
yamgent merged 4 commits into
MarkBind:masterfrom
crphang:integrate-google-analytics
Aug 6, 2019
Merged

Add google analytics support#929
yamgent merged 4 commits into
MarkBind:masterfrom
crphang:integrate-google-analytics

Conversation

@crphang

@crphang crphang commented Jul 13, 2019

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request?

  • New feature

Resolves #355
Resolves #902

Remaining Tasks:

  • User Guide
  • Add test to show that plugin indeed generates google analytics.

What is the rationale for this request?

To provide easy way for authors to add google analytics into their web built by markbind. This PR adds this support by adding additional Google Analytics plugin.

image

What changes did you make? (Give an overview)

  • Added a Google Analytics plugin

Provide some example code that this change will affect:

Add to site.json accordingly

{
  "plugins": ["googleAnalytics"],
  "pluginsContext" : {
    "googleAnalytics" : {
      "trackingID": "UA-143800593-1"
    }
  }
}

This will be further simplified with #930

@crphang crphang force-pushed the integrate-google-analytics branch 2 times, most recently from 5757828 to 9765a61 Compare July 13, 2019 09:29
@crphang crphang changed the title [WIP] Add google analytics support Add google analytics support Jul 14, 2019
@crphang

crphang commented Jul 14, 2019

Copy link
Copy Markdown
Contributor Author

Ready for review.

Would require additional help on functional testing portion. Not entirely sure what is the adopted/best practice.

@yamgent yamgent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase to the latest master, so that we can remove the unrelated changes such as test/functional/test_site/expected/diagrams/usecase.png.


Would require additional help on functional testing portion. Not entirely sure what is the adopted/best practice.

I think the current implementation of yours is the best we can do. If in the future, Google drastically changes the method of tracking users, we will just have to rely on user reports to update on our side.

Comment thread docs/userGuide/plugins/googleAnalytics.mbdf Outdated
Comment thread docs/userGuide/plugins/googleAnalytics.mbdf Outdated
Comment thread docs/userGuide/usingPlugins.md Outdated
Comment thread test/functional/test_site/testGoogleAnalytics.md Outdated
@crphang crphang force-pushed the integrate-google-analytics branch from 57c9ca5 to b0e36b0 Compare July 27, 2019 09:31
@crphang

crphang commented Jul 27, 2019

Copy link
Copy Markdown
Contributor Author

@yamgent made changes. Ready for review. Thanks for reviewing

@yamgent yamgent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm interesting, the diagrams seems to change due to it being rendered differently (I presume it is because different OS renders the diagrams differently?)

Anyway, one minor nit, otherwise this seems good to go.

@@ -0,0 +1,24 @@
#### `Google Analytics`: Enhancing site with Google Analytics

This plugin allows your web pages to be enhanced with [google analytics](https://analytics.google.com/analytics/web/#/) to track, analyse and improve your content..

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the duplicate dots at the end.

@damithc

damithc commented Jul 29, 2019

Copy link
Copy Markdown
Contributor

Hmm interesting, the diagrams seems to change due to it being rendered differently (I presume it is because different OS renders the diagrams differently?)

What do we do about this? The diagrams shouldn't be part of this PR right?

@yamgent

yamgent commented Jul 31, 2019

Copy link
Copy Markdown
Member

What do we do about this? The diagrams shouldn't be part of this PR right?

Yes, I am of the view that the changes should be discarded for now in this PR, since the original source code of the diagram did not change.

If the source code changes, then the PR that made the changes should update the diagram (for that case, I think it is OK if the PR author is not using Windows to update them, since pictures need manual verification anyway...)

@damithc

damithc commented Jul 31, 2019

Copy link
Copy Markdown
Contributor

Yes, I am of the view that the changes should be discarded for now in this PR, since the original source code of the diagram did not change.

If the source code changes, then the PR that made the changes should update the diagram (for that case, I think it is OK if the PR author is not using Windows to update them, since pictures need manual verification anyway...)

Does that also mean every PR coming from a non-Windows contributor will be required to remove unrelated changes from the PR every time? 😨

@yamgent

yamgent commented Jul 31, 2019

Copy link
Copy Markdown
Member

Does that also mean every PR coming from a non-Windows contributor will be required to remove unrelated changes from the PR every time? 😨

A possible way to alleivate this issue for now is to get rid of PlantUML diagrams in the functional tests.

Ideally, it would be great if someone could try and find ways to make the style consistent across all OS (I haven't research enough to say whether this is feasible with PlantUML though).

@crphang crphang force-pushed the integrate-google-analytics branch from 132e842 to c964a88 Compare August 4, 2019 09:10
@crphang

crphang commented Aug 4, 2019

Copy link
Copy Markdown
Contributor Author

@yamgent Removed diagram changes and typo. Ready for review.

@yamgent yamgent added this to the v2.5.4 milestone Aug 5, 2019
@yamgent yamgent merged commit 9239686 into MarkBind:master Aug 6, 2019
crphang added a commit to crphang/markbind that referenced this pull request Sep 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support easy integration of Google Analytics Support google analytics

3 participants